﻿//var count=1;
//var upload1;
var upload9;
//var upload4;
var upload10;
function goCustom(){
	$("#msgContent").val("快去定制哦");
}
function goShare(){
	$("#msgContent").val("快去分享哦");
}
var reportstr_own="<div id='report_div' align='center'>"+
"<table align='center' bgcolor='#FFFAFO'>"+
	"<tr>"+
		"<td>"+
			"举报他"+
		"</td>"+
		"<td>"+
			"<input type='text' name='beReportName' id='beReportName' readonly='readonly' size='30px'/><br/>"+
		"</td>"+
	"</tr>"+
	"<tr>"+
		"<td>"+
			"举报情况:"+
		"</td>"+
		"<td>"+
			"<textarea rows='6' cols='55' name='reportContent' id='reportContent'></textarea><br/>"+
		"</td>"+
	"</tr>"+
"</table>"+
"</div>";




var privatetalkstr_own="<div id='privatemessage' align='center' style='background-color:#FFFAFO;'>"+
"<table align='center'>"+
	"<tr>"+
		"<td>"+"发给:"+"</td>"+
		"<td>"+
			"<input type='text' name='toName' id='toName' readonly='readonly'/>"+
		"</td>"+
	"</tr>"+
	"<tr>"+
			"<td>"+"内容:"+"</td>"+
			"<td>"+
				"<textarea rows='6' cols='70' name='messagContent' id='messagContent'></textarea>"+
			"</td>"+
	"</tr>"+
"</table>"+
"<div align='center'>"+
	"<table>"+
		  "<tr>"+
				"<td>"+
					"<div align='right'>"+
						"<span id='spanButtonPlaceholder1'></span>"+
					"</div>"+
				"</td>"+
				"<td>"+
					"<div align='left'>"+
						"<input id='btnCancel1' type='button' value='取消上传的文件' onclick='cancelQueue(upload9)' disabled='disabled' style='margin-left: 2px; height: 22px; font-size: 8pt;' />"+
					"</div>"+
				"</td>"+
		  "</tr>"+
	      "<tr>"+
			"<td colspan='2' align='center'>"+
				"<div class='fieldset flash' id='fsUploadProgress1'>"+
					"<span class='legend'>文件上传</span>"+
				"</div>"+
			"</td>"+
      "</tr>"+
	"</table>"+
"</div>"+
"</div>";


var customuploadfilestr_own="<div id='customuploadfilestrdiv' align='center'>"+
"<table align='center' bgcolor='#FFFAFO'>"+
	"<tr>"+
		"<td colspan='2'>"+
			"<div class='fieldset flash' id='fsUploadProgress4' style='float: center;'>"+
				"<span class='legend'>文件上传</span>"+
			"</div>"+
		"</td>"+
	"</tr>"+
	"<tr>"+
		"<td>"+
			"<span id='spanButtonPlaceholder4'></span>"+
		"</td>"+
		"<td>"+
			"<input id='btnCancel4' type='button' value='取消上传的文件' onclick='cancelQueue(upload10)' disabled='disabled' style='margin-left: 2px; height: 22px; font-size: 8pt;' />"+
		"</td>"+
	"</tr>"+
"</table>"+
"</div>";


function changeFontSize(){
	//var limitSize= $("#fontSize").html();
	var newSize=$("#msgContent").val().length;
	if(80-newSize>=0){
		if(80-newSize<10){
			$("#fontSize").html(80-newSize);
			document.getElementById("fontSize").style.color="red";
		}else{
			document.getElementById("fontSize").style.color="black";
			$("#fontSize").html(80-newSize);
		}
	}else{
			$("#msgContent").val($("#msgContent").val().substr(0,80));
	}
}

function picturemouseover(){

	$("#fangxiangdiv").fadeIn(100);
}
function ShowMoreComment(Customid){
	//alert(Customid);
	window.open("ShareInfo?_id="+Customid);
}
function picturemouseout(){
	//alert("sa");
	$("#fangxiangdiv").hide();
}
function clickLeftPic(){
	$("#myShowCar_id").attr("src","img/test5.jpg");
	//alert("left");
}
function clickRightPic(){
	$("#myShowCar_id").attr("src","img/test3.jpg");
}




function initSWFUpload10(customId,toName,sourse) {
	var settingsup = {
		flash_url : "swfupload/swfupload.swf",
		 upload_url: "CustomUpdateFileAction",
		 post_params: {"customId":customId,"toName":toName,"sourse":sourse},
		file_size_limit : "100 MB",
		file_post_name: "files",
		file_types : "*.txt;*.gif",
		file_types_description : "txt模式和JPG",
		file_upload_limit : 100,
		file_queue_limit : 0,
		custom_settings : {
			progressTarget : "fsUploadProgress4",
			cancelButtonId : "btnCancel4"
		},
		debug: false,

		//button_image_url: "img/51.png",
		button_width: "80",
		button_height: "29",
		button_placeholder_id: "spanButtonPlaceholder4",
		button_text: '<span class="theFont">选取文件</span>',
		button_text_style: ".theFont { font-size: 16; }",
		button_text_left_padding: 12,
		button_text_top_padding: 3,

		// The event handler functions are defined in handlers.js
		file_dialog_start_handler : fileDialogStart_action,
		file_queued_handler : fileQueued_action,
		file_queue_error_handler : fileQueueError_action,
		file_dialog_complete_handler : fileDialogComplete_action,
		upload_start_handler : uploadStart_action,
		upload_progress_handler : uploadProgress_action,
		upload_error_handler : uploadError_action,
		upload_success_handler : uploadSuccess_action,
	    upload_complete_handler : uploadComplete_action
	};
	upload10 = new SWFUpload(settingsup);
 };




function showfriendshareothercomment(customId){
	//alert(customId);
	$("#"+customId+"friendshareothercomment").show(500,function(){
		$("#"+customId+"friendshareothercomment").click(function(){
			$("#"+customId+"friendshareothercomment").hide();
		});
	});
}

function showfriendorderothercomment(customId){
	$("#"+customId+"friendorderothercomment").show(500,function(){
		$("#"+customId+"friendorderothercomment").click(function(){
			$("#"+customId+"friendorderothercomment").hide();
		});
	});
}

function CustomUploadFiledialog(customId,toName,sourse){

	$("#customUploadFiledialog").dialog({
	//$("#register-form").dialog({
		 resizable:false,
   	  //show: "slide",
   	  autoOpen:true,
         module : true,
         width:600,
         height:400,
         position:[getLeft(600),getTop(400)],//定位
         title: "给他发个文件看",
         open:function(){
       		 $("#customUploadFiledialog").html(customuploadfilestr_own).fadeIn();
        	 $("#privatemessage").html("");
        	// $("#register-form").html("");
        	 //$("#register-form").append(customuploadfilestr_own).fadeIn();
        	 initSWFUpload10(customId,toName,sourse);
         },
         close: function(event, ui){
       	  		$("#customuploadfilestrdiv").html("");
       	  		$("#customUploadFiledialog").html("");
         },
         buttons:{
       	  '提交' :function(){
       		  if(upload10.getStats().files_queued === 0){
       			OpenTheSHowDialog("无任何文件，您先选择文件！");
       		  }else{
       			  sendswf4();
       		      //$(this).dialog('close');
       		  }
       	  },
       	  '取消':function(){
       		  $(this).dialog('close');
       	  }
         },
	 });
}

function sendCommentInOwnMessageByOrder(orderId,source){
	if(source==0){
		var content=$("#"+orderId+"dingzhicontent").val();
		if(content==null||content==""){
			OpenTheSHowDialog("亲，请输入内容哦！");
		}else{
			$.post('CommentFriendCustomsByAjAxAction',{'customid':orderId,'textContent':content,'sourse':source},function(data){
			 	if(data=="success"){
			 		$("#"+orderId+"dingzhicontent").val("");
			 		$.getJSON('GetTheLastCommentByCustomId',{'CustomId':orderId,'sourse':source},function(data){
			 			$("."+orderId+"Comment").html("");
			 			$("."+orderId+"Comment").append("<a href='getFriendOwnMessageAction?uname="+data.comment.userName+"'>"+data.comment.userName+"</a>:"+data.comment.commentContent+newData(data.comment.commentTime)+"<br/>");
			 			$("."+orderId+"Comment").append("<span style='float: right'><a style='font-size: 11px;' href='javascript:void(0);' onclick='openDialog(\""+data.comment.userName+"\")'>私聊</a>|<a style='font-size: 11px;' href='javascript:void(0);' onclick='openReportDialog(\""+data.comment.userName+"\","+data.comment.commentId+")'>举报</a></span><br/>");
			 			$("."+orderId+"comemntcount").html(data.commentCountbycustomid);
			 			//$("."+customId+"friendothercomment").append("<a href='getFriendOwnMessageAction?uname="+data.comment.userName+"'>"+data.comment.userName+"</a>:"+data.comment.commentContent+data.comment.commentTime+"<br/>");
			 			//$("."+customId+"friendothercomment").append("<span style='float: right'><a href='javascript:void(0);' onclick='openDialog(\""+data.comment.userName+"\")'>私聊</a>|<a href='javascript:void(0);' onclick='openReportDialog(\""+data.comment.userName+"\","+data.comment.commentId+")'>举报</a></span><br/>");
			 		});
			 		OpenTheSHowDialog("插入成功啦！");
			 	}else{
			 		$("#"+orderId+"dingzhicontent").val("");

			 		OpenTheSHowDialog("插入失败了，哎！");
			 	}
		 });
	}
	}else if(source==1){
			var content=$("#"+orderId+"dingzhicontentnopay").val();
			if(content==null||content==""){
				OpenTheSHowDialog("亲，请输入内容哦！");
			}else{
				$.post('CommentFriendCustomsByAjAxAction',{'customid':orderId,'textContent':content,'sourse':source},function(data){
				 	if(data=="success"){
				 		$("#"+orderId+"dingzhicontentnopay").val("");
				 		$.getJSON('GetTheLastCommentByCustomId',{'CustomId':orderId,'sourse':source},function(data){
				 			$("."+orderId+"Commentnopay").html("");
				 			$("."+orderId+"Commentnopay").append("<a href='getFriendOwnMessageAction?uname="+data.comment.userName+"'>"+data.comment.userName+"</a>:"+data.comment.commentContent+newData(data.comment.commentTime)+"<br/>");
				 			$("."+orderId+"Commentnopay").append("<span style='float: right'><a style='font-size: 11px;' href='javascript:void(0);' onclick='openDialog(\""+data.comment.userName+"\")'>私聊</a>|<a style='font-size: 11px;' href='javascript:void(0);' onclick='openReportDialog(\""+data.comment.userName+"\","+data.comment.commentId+")'>举报</a></span><br/>");
				 			$("."+orderId+"comemntcountnopay").html(data.commentCountbycustomid);
				 			//$("."+customId+"friendothercomment").append("<a href='getFriendOwnMessageAction?uname="+data.comment.userName+"'>"+data.comment.userName+"</a>:"+data.comment.commentContent+data.comment.commentTime+"<br/>");
				 			//$("."+customId+"friendothercomment").append("<span style='float: right'><a href='javascript:void(0);' onclick='openDialog(\""+data.comment.userName+"\")'>私聊</a>|<a href='javascript:void(0);' onclick='openReportDialog(\""+data.comment.userName+"\","+data.comment.commentId+")'>举报</a></span><br/>");
				 		});
				 		OpenTheSHowDialog("插入成功啦！");
				 	}else{
				 		$("#"+orderId+"dingzhicontentnopay").val("");
				 		OpenTheSHowDialog("插入失败了，哎！");
				 	}
			 });
		}
	}
}
function getCurrentDate(){
	var new_date=new Date();
	var dateStr=new_date.getFullYear()+"/"+new_date.getMonth()+"/"+new_date.getDate()+
	" "+new_date.getHours()+":"+new_date.getMinutes()+":"+new_date.getMinutes();
	return dateStr;
	// example 2012-3-3 12:45:12
}

function sendCommentInOwnMessageByShare(customId,sourse){
	//alert(customId);
	//alert(sourse);
	if(sourse==0){
		//var content=$(this).parent().prev().children().eq(0).val();
		alert($(this).parents(".share_child_commenttext").children().eq(0));
		if(content==null||content==""){
			OpenTheSHowDialog("亲，请输入内容哦！");
		}else{
			$.post('CommentFriendCustomsByAjAxAction',{'customid':customId,'textContent':content,'sourse':sourse},function(data){
			 	if(data=="success"){
			 		$(this).parent().prev().children().eq(0).val("");
			 		$.getJSON('GetTheLastCommentByCustomId',{'CustomId':customId,'sourse':sourse},function(data){
//			 			$("."+customId+"Comment").html("");
//			 			$("."+customId+"Comment").append("<a href='getFriendOwnMessageAction?uname="+data.comment.userName+"'>"+data.comment.userName+"</a>:"+data.comment.commentContent+newData(data.comment.commentTime)+"<br/>");
//			 			$("."+customId+"Comment").append("<span style='float: right'><a style='font-size: 11px;' href='javascript:void(0);' onclick='openDialog(\""+data.comment.userName+"\")'>私聊</a>|<a style='font-size: 11px;' href='javascript:void(0);' onclick='openReportDialog(\""+data.comment.userName+"\","+data.comment.commentId+")'>举报</a></span><br/>");
//			 			$("."+customId+"comemntcount").html(data.commentCountbycustomid);
			 			$(this).parents(".share_content_left_child_usertext").append(123);

			 		});
			 		OpenTheSHowDialog("插入成功啦！");
			 	}else{
			 		$(this).parent().prev().children().eq(0).val("");
			 		OpenTheSHowDialog("插入失败了，哎！");
			 	}
		 });
		}
	}else{
		var content=$(this).parent().prev().children().eq(0).val();
		if(content==null||content==""){
			OpenTheSHowDialog("亲，请输入内容哦！");
		}else{
			$.post('CommentFriendCustomsByAjAxAction',{'customid':customId,'textContent':content,'sourse':sourse},function(data){
			 	if(data=="success"){
			 		$(this).parent().prev().children().eq(0).val("");
			 		$.getJSON('GetTheLastCommentByCustomId',{'CustomId':customId,'sourse':sourse},function(data){
//			 			$("."+customId+"Commentnobuycanshare").html("");
//			 			$("."+customId+"Commentnobuycanshare").append("<a href='getFriendOwnMessageAction?uname="+data.comment.userName+"'>"+data.comment.userName+"</a>:"+data.comment.commentContent+newData(data.comment.commentTime)+"<br/>");
//			 			$("."+customId+"Commentnobuycanshare").append("<span style='float: right'><a style='font-size: 11px;' href='javascript:void(0);' onclick='openDialog(\""+data.comment.userName+"\")'>私聊</a>|<a style='font-size: 11px;' href='javascript:void(0);' onclick='openReportDialog(\""+data.comment.userName+"\","+data.comment.commentId+")'>举报</a></span><br/>");
//			 			$("."+customId+"comemntcountnobuycanshare").html(data.commentCountbycustomid);
			 			$(this).parents(".share_content_left_child_usertext").append(456);
			 		});
			 		OpenTheSHowDialog("插入成功啦！");
			 	}else{
			 		$(this).parents(".share_content_left_child_usertext").append(123);
			 		OpenTheSHowDialog("插入失败了，哎！");
			 	}
		 });
		}
	}


}


function sendswf(){
	 upload9.startUpload();
}
function sendswf4(){
	 upload10.startUpload();
}
function newData(d){
	var i=d.indexOf("T");
	var str=" "+d.substr(0,i)+" "+d.substr(i+1,d.length);
	return str;

}

function initSWFUpload() {
	var settings = {
		flash_url : "swfupload/swfupload.swf",
		 upload_url: "PrivateTalkSWFUploadAction",
		 post_params: {"toName" :$("#toName").val()},
		file_size_limit : "100 MB",
		file_post_name: "file",
		file_types : "*.txt;*.gif",
		file_types_description : "txt模式和JPG",
		file_upload_limit :100,
		file_queue_limit : 0,
		custom_settings : {
			progressTarget : "fsUploadProgress1",
			cancelButtonId : "btnCancel1"
		},
		debug: false,

		//button_image_url: "img/51.png",
		button_width: "80",
		button_height: "29",
		button_placeholder_id: "spanButtonPlaceholder1",
		button_text: '<span class="theFont">选取文件</span>',
		button_text_style: ".theFont { font-size: 16; }",
		button_text_left_padding: 12,
		button_text_top_padding: 3,

		// The event handler functions are defined in handlers.js
		file_dialog_start_handler : fileDialogStart_privateTalk,
		file_queued_handler : fileQueued_privateTalk,
		file_queue_error_handler : fileQueueError_privateTalk,
		file_dialog_complete_handler : fileDialogComplete_privateTalk,
		upload_start_handler : uploadStart_privateTalk,
		upload_progress_handler : uploadProgress_privateTalk,
		upload_error_handler : uploadError_privateTalk,
		upload_success_handler : uploadSuccess_privateTalk,
	    upload_complete_handler : uploadComplete_privateTalk,
	};
	upload9 = new SWFUpload(settings);
 };



function getTop(height){
	var windowheight=window.innerHeight;
	return (windowheight-height)/2;
}
function getLeft(width){
	var windowwidth=window.innerWidth;
	return (windowwidth-width)/2;
}
/*function showothercomment(id){
			var _id=id+10000000000;
			document.getElementById(_id).style.display="";
		}*/
		function commentdivmouseout(id){
			document.getElementById(id).style.display="none";
		}
		/*function showothercommentshare(id){
			var _id=id+20000000000;
			document.getElementById(_id).style.display="";
		}*/
		function commentdivmouseoutshare(id){
			document.getElementById(id).style.display="none";
		}
		function showshare(){

			document.getElementById("dingzhiall_out").style.display="none";
			document.getElementById("shareall_out").style.display="block";
			document.getElementById("sharediv").className="myfriend_friendactivity_content_right_select_mymoney2";
			document.getElementById("dingzhidiv").className="myfriend_friendactivity_content_right_select_mymoney";
		}
		function showdingzhi(){
			document.getElementById("dingzhiall_out").style.display="";
			document.getElementById("shareall_out").style.display="none";
			document.getElementById("sharediv").className="myfriend_friendactivity_content_right_select_mymoney";
			document.getElementById("dingzhidiv").className="myfriend_friendactivity_content_right_select_mymoney2";
		}
		function addfriends(value){
			if(window.confirm("确定增加对方为好友么？")){
				var value=document.getElementById("needaddfirendvalue").value;
				var url = "AddFriendsAction";
				if(value!=""&&value!=null){
					$.post(url,{addUser:value},function(data){//传入的值和返回来的值
							if(data =="true"){
								 OpenTheSHowDialog("已经加为好友！");
								document.getElementById("addf").style.display="none";
								return data;
							}else if(data=="false"){
								 OpenTheSHowDialog("增加好友失败！");
								return data;
							}
					});
				}

			}
		}




		$(function(){
			$("a#showmylovecar").fancybox();
			$("a[rel=example_group]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});

			$("button").button();
			$("div.holder2").jPages({
	            containerID :"shareall",
				first: '首页',
				last: '尾页',
				previous: '上页',
				next: '下页',
	            perPage:2,
	            startPage:1,
				keyBrowse: true,
				callback:function(pages,items){
					items.showing.find("img").trigger("turnPage");
					items.oncoming.find("img").trigger("turnPage");
				}
          });
			$("div.holder").jPages({
	            containerID :"dingzhiall",
				first: '首页',
				last: '尾页',
				previous: '上页',
				next: '下页',
	            perPage:2,
	            startPage:1,
				 keyBrowse: true,
				callback:function(pages,items){
					items.showing.find("img").trigger("turnPage");
					items.oncoming.find("img").trigger("turnPage");
				}
          });
        	  $("div.holder3").jPages({
  	            containerID :"itemContainerc",
  				first: '首页',
  				last: '尾页',
  				previous: '上页',
  				next: '下页',
  	            perPage:3,
  	            startPage:1,
  				callback:function(pages,items){
  					items.showing.find("img").trigger("turnPage");
  					items.oncoming.find("img").trigger("turnPage");
  				}
            });
        	  $("#shareall_out").hide();
        });




		function openDialog(customName){
			var content="";
			 $("#register-form").dialog({
	        	  resizable:false,
	        	  show: "slide",
	        	  autoOpen:true,
	              module : true,
	              width:600,
	              height:450,
	              position:[getLeft(600),getTop(450)],//定位
	              title: "找他私聊下",
	              open:function(){
	            	  $("#register-form").html("");
	            	  $("#register-form").append(privatetalkstr_own).fadeIn();
	            	  $("#toName").val(customName);
	            	  setTimeout("initSWFUpload()",500);
	              },
	              close: function(event, ui){
	            	 // $("#privatemessage").val("");
	            	  $("#privatemessage").html("");
	            	  $("#messagContent").val("");

	            	  //$("#register-form").html("");
	              },
	              buttons:{
	            	  '提交' :function(){
	            		  content= $("#messagContent").val();
	            		  if(content==null||content==""){
	            			  OpenTheSHowDialog("您还没输入内容！");
	            		  }else{
	            			  if(upload9.getStats().files_queued !== 0){
		            			  sendswf();
		            		  }else if(upload9.getStats().files_queued === 0){
		            				//alert("file is null");
		            			  $.post('SwfSuccessToDateBase',{'toName':$("#toName").val(),'filesName':"",'messageContent':$("#messagContent").val()},function(data){
		            					if(data=="true"){
		            						OpenTheSHowDialog("您的私聊已经发到！");
		            					}else{
		            							OpenTheSHowDialog("发送失败！");
		            							$("#register-form").dialog("close");
		            					}
		            				});
		            		  }
	            		  }
	            	  },
	            	  '取消':function(){
	            		  $(this).dialog('close');
	            	  }
	              },
	        });
		}

      function openReportDialog(customName,commentId){
	        $( "#report-form").dialog({
	        	  resizable:false,
	        	  show: "slide",
	        	  autoOpen:true,
	              module : true,
	              width:700,
	              height:350,
	              position:[getLeft(600),getTop(350)],//定位
	              title: "我要举报他",
	              open:function(){
	            	  $("#report-form").html("");
	            	  $("#report-form").append(reportstr_own).fadeIn();
	            	 /* if(count==1){
	            		  $(this).append(reportstr_own).fadeIn();
	            		  count=2;
	            	  }*/
	            	  document.getElementById("reportContent").focus();
	            	  //document.getElementById("beReportName").value=customName;
	            	  $("#beReportName").val(customName);
	              },
	              close: function(event, ui){
	            	  $("#reportContent").val("");
	              },
			      buttons:{
				    '提交' : function() {
				    	var Content=document.getElementById("reportContent").value;
				    	if(Content==null||Content==""){
				    		OpenTheSHowDialog("亲，您还没有输入举报的理由呢！");
				    	}else{
				    		$.post('SendReportByAjAxAction',{'beReportName':customName,'commentId':commentId,'reprotContent':Content},function(data){//传入的值和返回来的值
								if(data =="true"){
									OpenTheSHowDialog("举报成功！我们会尽快处理");
									$("#report-form").dialog('close');
									//return data;
								}else if(data=="false"){
									OpenTheSHowDialog("举报失败");
									//return data;
								}
					    	});
				    	}
				    },'取消' :function(){
				    	$(this).dialog('close');
				    }
				 },
	        });
    }

      function openFileImage(){
	      	document.getElementById("upimage").click();
      }
      function openFile(){
	      	document.getElementById("ofile").click();
      }
      function openFileImage2(){
	      	document.getElementById("upimage2").click();
      }
      function openFile2(){
	      	document.getElementById("ofile2").click();
      }
      function selectNewFriend(){
      		var selectname=document.getElementById("selectNewFriend").value;
       		var f=document.getElementById("selectform");
      	if(selectname==""||selectname==null){
      		OpenTheSHowDialog("不能为空");
      	}else{
      		$.post("CheckNameAction",{uname:selectname},function(data){
      			if(data=="true"){
      				f.action="getFriendOwnMessageAction";
      	      		f.submit();
      			}else{
      				OpenTheSHowDialog("还没有这个用户哦");
      				$("#selectNewFriend").val("");
      			}
      		});
      	}
      }


      function check(){
      		var val=document.getElementById("msgContent").value;
      		if(val==""||val==null){
      			OpenTheSHowDialog("发送信息不能为空");
      			//return false;
      		}else{
      			var oform=document.getElementById("msgform");
     			oform.submit();
      		}
      }


      function changeimageandfile(){
     	var c=document.getElementById("upimage").value;//获取文本控件的值，显示到页面
     	var ex=c.substring(c.indexOf(".")+1,c.length);
     	if(ex=="gif"||ex=="png"||ex=="jpg"||ex=="jpeg"){
     		$("#selectfilenamediv").html("上传的图片名为："+c);
     	}else{
     		OpenTheSHowDialog("图片类型只能为gif或png或jpg或jpeg");
     		document.getElementById("upimage").outerHTML = document.getElementById("upimage").outerHTML;
     	}
      }
      function changeupdatefile(){
    	  if(document.getElementById("upimage").value==""||document.getElementById("upimage").value==null){
    		  OpenTheSHowDialog("您先选择上传的图片(gif或png或jpg或jpeg)，才能选择文件(cdr或ai或psd)！");
    	  }else{
    		    var d=document.getElementById("ofile").value;//获取文本控件的值，显示到页面
  	     		var ex=d.substring(d.indexOf(".")+1,d.length);
  	     		if(ex=="cdr"||ex=="ai"||ex=="psd"||ex=="txt"){
  	     			$("#selectfilenamediv").html($("#selectfilenamediv").html()+"<br/>"+"上传的文件名为："+d);
  	     		}else{
  	     			OpenTheSHowDialog("文件类型只能为(cdr或ai或psd)");
  	     			document.getElementById("ofile").outerHTML = document.getElementById("ofile").outerHTML;
  	     	     }
    	  }

      }
      function OpenTheSHowDialog(message){
			$("#report_success").html(message).dialog({
				autoOpen:true,
				width:300,
				height:180,
				position:[getLeft(300),getTop(180)],
				buttons:{
					确定:function(){
						$(this).dialog("close");
					}
				}
			});
		}